import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: syyyy
 * Date: 2025-07-17
 * Time: 12:53
 */
public class Test {
    public static int[] merge(int[] A,int m, int[] B,int n){
        int[] C=new int[m+n];

        for(int i=0;i<m;i++){
            C[i]=A[i];
        }
        for(int i=m;i<m+n;i++){
            C[i]=B[i-m];
        }

        for (int i = 0; i < C.length-1; i++) {
            boolean ischange=false;
            for(int j=0;j<C.length-i-1;j++){
                if(C[j]>C[j+1]){
                    int tmp=C[j+1];
                    C[j+1]=C[j];
                    C[j]=tmp;
                    ischange=true;
                }
            }
            if(!ischange){
                break;
            }
        }
        return C;

    }
    public static void main(String[] args) {
        int[] A={4,5,6};
        int[] B={1,2,3};
        int m=A.length;
        int n=B.length;
        int[] C=merge(A,m,B,n);
        System.out.println(Arrays.toString(C));
    }
}
